09. Organizing your files (mkdir, mv)

Organizing your files

With the Shell, you can use commands to organize your files into directories, move files, copy or remove the files.

Use the workspace below the video to practice the commands and remember to practice locally in your computer too.

Ud206 009 Shell P6 - Organizing Your Files

Commands

  • mkdir: Creates directories.
  • mv: Move files from a directory to another.

## Workspace

You can use this workspace to test your commands.

Code

If you need a code on the https://github.com/udacity.

Moving them back

Let's say I change my mind and want to move the epub files back from Documents/Books to Documents. How can I do this? My current working directory is my home directory, and Documents is inside that directory.
Mark each answer that would work:

SOLUTION:
  • `mv Documents/Books/* Documents`
  • `cd Documents; mv Books/*.epub .`
  • `cd Documents/Books; mv * ..`

By the way, when you quote something in the shell, you always use straight quotes. This is what you'll get if you type into a terminal window. However, if you copy and paste from a web page or document, you should be really careful to make sure that it hasn't accidentally been written with “curly quotes”. Curly quotes will not work in the shell.

Single quotes and double quotes do slightly different things in the shell. If you're unsure which to use, go for single quotes.

Recomendation

The Shell commands can be installed or not on your computer if you are using Linux or Mac and you have issues running the commands check the documentation specifically for the Operating System.